<template>
  <!--单例模式，name相同则复用一个无界实例，改变url则子应用重新渲染实例到对应路由 -->
  <WujieVue width="100%" height="100%" name="vue2" :url="vue2Url"></WujieVue>
</template>

<script>


export default {
  data() {
    return {
      urlPath: this.getUrlPath() //iframe src 路径
    };
  },
  computed: {

    vue2Url() {
      //debugger
      let rh = this.$route.hash;
      rh = rh ? rh.substring(0,rh.indexOf('&')):'';
      console.log(rh);
      rh = this.$route.query.src
        ? this.$route.query.src.replace("$", "#") + rh
        : this.urlPath;
        console.log(rh);
        return rh
    }
  },
  methods: {
    jump(name) {
      this.$router.push({ name });
    },
    getUrlPath: function() {
      //获取 iframe src 路径
      let url = window.location.href;
      url = url.replace("/myiframe", "");
      return url;
    }
  },
};
</script>

<style lang="scss" scoped></style>
